package com.impetus.project.skilltest.client.pages;

import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class ErrorPage {

	public boolean loadPage(PageData pageData)
	{
		Label errorLabel = new Label(pageData.getExceptionCaught().getMessage());
		Label errorTrace = new Label(pageData.getExceptionCaught().toString());
		
		HorizontalPanel menuPanel = TopMenu.drawMenu(pageData);
		
		final VerticalPanel vpanel = new VerticalPanel();
		vpanel.add(menuPanel);
		vpanel.addStyleName("center");
		vpanel.add(errorLabel);
		vpanel.add(errorTrace);
		
		RootPanel.get().clear();
		RootPanel.get().add(vpanel);
		
		return true;
	}
}
